package org.dev.`as`.project.main.degrade

import android.content.Context
import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.facade.service.DegradeService
import org.dev.`as`.project.common.route.HiRoute

/**
 * Author WenPing
 * CreateTime 2021/5/16.
 * Description:
 * 全局降级服务,当路由的时候，目标页不存在，此时重定向到统一错误页
 */
@Route(path = "/degrade/global/service")
class DegradeServiceImpl : DegradeService {
    override fun onLost(context: Context?, postcard: Postcard?) {
        HiRoute.startActivity(
            null,
            destination = HiRoute.Destination.DEGRADE_GLOBAL
        )
    }

    override fun init(context: Context?) {
        // no implementation
    }
}